<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\admin\model;

use plugin\saiadmin\basic\BaseModel;

/**
 * 订单表模型
 */
class Order extends BaseModel
{

    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'id';

    /**
     * 数据库表名称
     * @var string
     */
    protected $table = 'order';

    /**
     * 关联模型 OrderDetails
     */
    public function orderDetails()
    {
        return $this->hasMany(OrderDetail::class, 'order_id', 'id');
    }

    public function orderRating()
    {
        return $this->hasOne(OrderRating::class, 'order_id', 'id');
    }

}
